﻿using System;
using System.Collections;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using LitJson;


namespace RichECMS.news
{
    public partial class Populate_Dynamic_Content : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string strReq = Request["uuid"] ?? "";
            strReq = strReq.Replace("style_id_", "");
            if (!ValidateCommon.ParamAuth.IsNumber(strReq))
            {
                strReq = "-1";
            }
            Response.AddHeader("Content-Type", "application/json; charset=UTF-8");
            Response.Write(BuilderResponse(strReq));
            Response.End();
            return;
        }

        protected string BuilderResponse(string intArtSecID)
        {
            Hashtable objHashTable = new Hashtable();

            Hashtable objOne = new Hashtable();
            objOne["image_request"] = "requested";
            objOne["style_code"] = "style_code_" + intArtSecID;
            objOne["created_at"] = "2012-12-19T18:47:29Z";
            objOne["material_code_id"] = intArtSecID;
            objOne["full_price"] = "none";
            objOne["image_request_date"] = "2012-12-19T18:47:29Z";
            objOne["has_sizes"] = false;
            objOne["style_id"] = "style_id_" + intArtSecID;
            objOne["updated_at"] = "2012-12-19T18:47:29Z";
            objOne["show_phone_number"] = true;
            objOne["lovers"] = "0";
            objOne["gender_id"] = intArtSecID;
            objOne["id"] = intArtSecID;
            objOne["show_personal_shopper"] = true;
            objOne["line_id"] = null;
            objOne["shipping_method_available"] = false;
            objOne["skus"] = new Hashtable();
            objOne["discount_exempt"] = false;
            objOne["price"] = "";
            objOne["style_text_group_id"] = intArtSecID;
            objOne["phone_number"] = null;
            objOne["do_you_love_me"] = false;
            objOne["color_code_id"] = intArtSecID;
            objOne["image_request_comments"] = null;
            objOne["monogram_config_id"] = null;
            objOne["number_of_views"] = 1;

            Hashtable objOneHahs = new Hashtable();
            objOneHahs["style_id_" + intArtSecID] = objOne;

            Hashtable objstyle_wrappers=new Hashtable();
            objHashTable["style_wrappers"] = objOneHahs;

            objHashTable["missing_style_wrapper"] = false;

            return JsonMapper.ToJson(objHashTable);
        }
    }
}